import vue from '@vitejs/plugin-vue'

import createAutoImport from './auto-import'
import createComponents from "./auto-components"
import createSvgIcon from "./svg-icon"
import createCompression from "./compression"
import createIcons from "./auto-icons"

export default function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = [vue()]
  vitePlugins.push(createAutoImport())
  vitePlugins.push(createComponents())
  vitePlugins.push(createSvgIcon(isBuild))
  vitePlugins.push(createIcons())
  isBuild && vitePlugins.push(...createCompression(viteEnv))
  return vitePlugins;
}